1. Field of the Invention
The present invention relates to the field of processors. More specifically, the present invention relates to the subject matter of constituting the datapath and its control logic of a processor.
2. Background Information
Every processor has a datapath and a corresponding control logic. The term datapath as used herein is a collective reference to the processor elements employed in performing arithmetic logic operations, whereas the term control logic as used herein is a collective reference to the processor elements employed in controlling the datapath to effectuate the desired arithmetic logic operations. The term processor as used herein is intended to include microcontrollers (MCU), digital signal processors (DSP), general purpose microprocessors (.mu.P), and the like. In the case of prior art processors, datapaths typically include arithmetic logic unit(s) (ALU), operand register or registers, control registers, and so forth. These prior art datapaths are typically controlled by control logic implemented in either hardwired logic or through microprogramming (also referred to as microcode or firmware).
The operand register(s) of a datapath varies (vary) from an accumulator approach, a stack approach or a register file approach. In the case of the stack based approach, one of the source as well as the destination operands of an instruction are implicitly defined to be located at the top of the stack, whereas, in the case of the accumulator based approach, one of the source as well as the destination operand of an instruction are implicitly defined to be located in the accumulator. Typically, the other source operand is located in a register. In the case of the register set based approach, the source and the destination operands of an instruction are either located in registers or in memory locations. While registers are specified by their identifiers, memory locations, whether cached or not, are specified by either physical or virtual addresses, depending on the manner in which memory is managed.
While the stack based approach enjoys the advantage of providing a simple model for expression evaluation, and short instruction, the approach suffers from at least the disadvantages of forcing all the operands onto the stack, and yet not being able to randomly access the pushed down operands in the stack, resulting in inefficient coding. As to the accumulator approach, while it minimizes the internal states of a processor, and provides for short instructions, it also suffers from at least the disadvantage of very high memory traffic, since the accumulator is the only temporary storage. The register based approach has the advantage of being the most general model for code generation, however, because of the access and related circuitry required to support a register, most prior art register based processors tend to provide only a limited number of registers, resulting in a relatively small working set. The disadvantage becomes especially limiting for heavily pipelined super-scalar processors.
With respect to the control logic, in the case of a hardwired implementation, typically one or more random control logic block are employed to generate the proper control signals to be output to control the datapath. The proper control signal to be output at a particular clock cycle is selected based on the current state of the processor, feedback from the datapath and the opcode of the next instruction to be executed. In the case of microprogrammed control logic, typically microinstructions are employed to specify the control signals for the datapath. The microinstructions are stored e.g. in a read-only-memory (ROM), and selected for output in each clock cycle, based on the current microinstruction program counter (PC). At each clock cycle, the microinstruction PC is modified based on a newly computed next microinstruction PC, the current microinstruction output (specifying in part the next microinstruction to be output), feedback from the datapath, and/or the opcode of the next instruction to be executed (also referred to as the next macroinstruction).
As a result, a processor designer has to operate and optimize the processor being designed at a pretty low level, which translates into complexity and low productivity. Furthermore, the processor designer has to employ different methodologies for the datapath and its control logic, which further compounds the complexity and low productivity problem. Thus, a more effective approach to designing and implementing a processor's datapath and its control logic without some of the prior art disadvantages is desired.